<?php

namespace app\common\validate\merchant;

use yiqiniu\extend\validate\YqnValidate;

/**
 * 统计验证
 */
class MerchantStatisticValid extends YqnValidate
{

    protected $rule = [
        'date' => 'require|in:day,month',
        'mer_id' => 'require',
        'statistic_date' => 'require',

    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名'    =>    '错误信息'
     *
     * @var array
     */
    protected $message = [
        'date.require' => '时间类型不能为空',
        'date.in' => '请选择时间类型',
        'mer_id.require' => '商户不能为空',
        'statistic_date.require' => '时间不能为空',
    ];

    //验证场景
    protected $scene = [
        'statistic' => ['date'],
        'statistic_data' => ['date','statistic_date','mer_id'],
    ];
}
